<html>
<head><meta charset="utf-8"><title>writeback · t-compiler/wg-rfc-2229 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/index.html">t-compiler/wg-rfc-2229</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html">writeback</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="217093431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217093431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217093431">(Nov 18 2020 at 03:48)</a>:</h4>
<p>Implementing writeback has issues stable hashing the closure min captures. </p>
<p>We keep getting the error </p>
<div class="codehilite"><pre><span></span><code>error: internal compiler error: compiler/rustc_middle/src/ich/impls_ty.rs:94:17: StableHasher: unexpected region &#39;_#2r
</code></pre></div>
<p>even though we replace the regions with <code>ReErased</code></p>
<p>We confirmed it's the min capture maps throwing an error because removing the call to stable hash min_capture in typechk tables fixes things&gt;</p>
<p>Here's the log: <a href="http://csclub.uwaterloo.ca/~jgwills/rust-builds/log_cf3df611-1c1e-42bf-9ea8-449b599163db">http://csclub.uwaterloo.ca/~jgwills/rust-builds/log_cf3df611-1c1e-42bf-9ea8-449b599163db</a> Backtrace at the very end, we were just dumping out all the Regions to see if someplace we might have a non erased region. </p>
<p>Here's what we did to implement writeback: <a href="https://github.com/rust-lang/rust/blob/010fea0d83f147887b1b7dc2f6dbf2ba87cfaa8e/compiler/rustc_typeck/src/check/writeback.rs#L333-L354">https://github.com/rust-lang/rust/blob/010fea0d83f147887b1b7dc2f6dbf2ba87cfaa8e/compiler/rustc_typeck/src/check/writeback.rs#L333-L354</a></p>
<p>Here's where the stable hasher is called: <a href="https://github.com/rust-lang/rust/blob/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/compiler/rustc_middle/src/ty/context.rs#L726">https://github.com/rust-lang/rust/blob/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/compiler/rustc_middle/src/ty/context.rs#L726</a></p>



<a name="217145552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217145552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217145552">(Nov 18 2020 at 15:01)</a>:</h4>
<p>hmm</p>



<a name="217145561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217145561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217145561">(Nov 18 2020 at 15:01)</a>:</h4>
<p>well that <em>is</em> confusing :)</p>



<a name="217145616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217145616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217145616">(Nov 18 2020 at 15:02)</a>:</h4>
<p>I would have expected us to create a new map, copying over from the old one, rather than modifying the old one in place, but I guess it's fine this way -- and more efficient</p>



<a name="217145674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217145674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217145674">(Nov 18 2020 at 15:02)</a>:</h4>
<p>I think the first place I would start is adding <code>debug!</code> logs of the full table information to see what's in there...</p>



<a name="217156082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217156082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217156082">(Nov 18 2020 at 16:07)</a>:</h4>
<p>Tried creating a fresh map too</p>



<a name="217267707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217267707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217267707">(Nov 19 2020 at 13:22)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> I can try to pull the changes locally, hard to say without dumping detailed debug info</p>



<a name="217267713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217267713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217267713">(Nov 19 2020 at 13:22)</a>:</h4>
<p>don't forget <code>-Zverbose</code> btw</p>



<a name="217267767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217267767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217267767">(Nov 19 2020 at 13:23)</a>:</h4>
<p>can you tell me the name of the repo/branch?</p>



<a name="217299217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217299217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217299217">(Nov 19 2020 at 17:01)</a>:</h4>
<p>joining, let's discuss during the meeting</p>



<a name="217299397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217299397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217299397">(Nov 19 2020 at 17:02)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> I'm in the zoom room...</p>



<a name="217299406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217299406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217299406">(Nov 19 2020 at 17:02)</a>:</h4>
<p>I don't see you</p>



<a name="217299414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217299414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217299414">(Nov 19 2020 at 17:02)</a>:</h4>
<p>did I join the wrong room?</p>



<a name="217299711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/writeback/near/217299711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/writeback.html#217299711">(Nov 19 2020 at 17:05)</a>:</h4>
<p><a href="https://github.com/sexxi-goose/rust/compare/writeback">https://github.com/sexxi-goose/rust/compare/writeback</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>